package com.maiji.cloud.entities.login;

import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableLogic;
import com.baomidou.mybatisplus.annotations.Version;
import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.annotation.Table;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import com.maiji.cloud.response.login.RecipeData;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.util.Date;

/**
 * 推荐食谱
 */
@NoArgsConstructor
@Data
@Accessors(chain=true)
@Table(name = "recipe")
public class Recipe extends RecipeData {

    @TableId
    @Column(name = "uu_id", type = MySqlTypeConstant.VARCHAR, length = 50, isKey = true)
    private String uuId; //主键

    @Column(name = "name", type = MySqlTypeConstant.VARCHAR, length = 20)
    private String name;  // 食谱名称

    @Column(name = "alias", type = MySqlTypeConstant.VARCHAR)
    private String alias;  // 食谱别名

    @Column(name = "look_up_no", type = MySqlTypeConstant.INT, length = 1, defaultValue = "0")
    private Integer lookUpNo; // 查看次数

    @Column(name = "collection_no", type = MySqlTypeConstant.INT, length = 1, defaultValue = "0")
    private Integer collectionNo; // 收藏次数

    @Column(name = "thumbs_up_no", type = MySqlTypeConstant.INT, length = 1, defaultValue = "0")
    private Integer thumbsUpNo; // 点赞次数

    @Column(name = "details_text", type = MySqlTypeConstant.VARCHAR, length = 100)
    private String detailsText;  // 详情

    @Column(name = "quantity_heat", type = MySqlTypeConstant.INT, length = 10)
    private Integer quantityHeat; // 热量

    @Column(name = "note", type = MySqlTypeConstant.TEXT)
    private String note;  // 注意事项

    @Column(name = "upload_time", type = MySqlTypeConstant.DATETIME)
    private Date uploadTime ;  //上传时间

    @Column(name = "update_time", type = MySqlTypeConstant.DATETIME)
    private Date updateTime ;  //最后修改时间

    @TableLogic
    @Column(name = "is_del", type = MySqlTypeConstant.INT, length = 1, defaultValue = "0")
    private Integer isDel; //是否删除：1删除，0未删除

    @Version
    @Column(name = "version", type = MySqlTypeConstant.INT, length = 1, defaultValue = "0")
    private Integer version; // 数据版本号

    @Override
    public String getUuId() {
        return uuId;
    }

}
